package cn.edu.scau.nursingcenter.service.impl;

import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.edu.scau.nursingcenter.dao.AdminRepository;
import cn.edu.scau.nursingcenter.entiry.Admin;
import cn.edu.scau.nursingcenter.service.AdminService;

@Service
public class AdminServiceImpl implements AdminService{

	@Autowired
	private AdminRepository adminRepository;
	
	/**
	  *管理员 登录
	 * @param name 管理员名字 
	 * @param password管理员密码
	 * @return 管理员对象
	 */
	@Override
	public Admin login(String name, String password) {
		if(StringUtils.isBlank(name)||StringUtils.isBlank(password)) {
			return null;
		}
		return adminRepository.login(name, password);
	}

}
